---
title: 
- "Replication package for Karreth, Quinn, Joshi, and Tir (JCR)"
subtitle:
- "International Third Parties and the Implementation of Comprehensive Peace Agreements After Civil War"
author: 
- Johannes Karreth
- Jason Quinn
- Madhav Joshi
- Jaroslav Tir
date: 
- June 21, 2022

output:
  rmdformats::readthedown:
    highlight: default
    smart: false
---

This folder contains all data and code to reproduce the analyses in:

> Karreth, Johannes, Jason Quinn, Madhav Joshi, and Jaroslav Tir. Forthcoming. "International Third Parties and the Implementation of Comprehensive Peace Agreements After Civil War." *Journal of Conflict Resolution*. [doi:10.1177/...](https://doi.org/10.1177...)

This document makes reference to the supporting information (SI), which is part of this replication package and also posted at <http://www.jkarreth.net>. For any questions, please contact the corresponding author at <jkarreth@ursinus.edu>.

To get straight to the analyses presented in the article, please open and run the script `2_analyze_implementation.R`. To reproduce from source the data used in the analyses, please continue reading below. 

# Software requirements

Please install R (version 4.0 or higher). A list of R packages used in this project is at the end of this file. One R package and two functions that are not on CRAN are in the "Software" folder of the replication package and can be loaded from there.

# Data sources

All raw data needed to create the data for analyses are provided within the folder Data > Source within the replication package. Data sources are discussed and cited in the article. **Please note that these raw files are provided for replication purposes only. Use the original source to obtain the newest and authoritative version of each dataset.**

The script `1_compile_data.R` imports, cleans, and merges these datasets to produce the analysis dataset, `implementation_allyears.csv`.

- `Source/PAM_ID V.1.5 Updated 29JULY2015.xlsx`: Peace Accords Matrix ([link](https://peaceaccords.nd.edu/research))
- `Source/HSIGO-CPA_c.rds`: Membership counts in highly structured IGOs, updated version from [Karreth (2018)](https://doi.org/10.1080/03050629.2018.1389728) and [*Incentivizing Peace*](http://www.jkarreth.net/incentivizing-peace.html), using the COW IGO data, version 3.0
- `Source/sourcex_data_RR.csv` and `Source/precGDP.csv`: a compilation of explanatory variables documented in the manuscript
  + AidData variables reflect the aggregate aid commitment by recipient year (based on `AidDataCoreDonorRecipientYear_ResearchRelease_Level1_v3.1.csv` from [AidData](https://www.aiddata.org/data/aiddata-core-research-release-level-1-3-1))
  + OECD variables reflect total official aid flows based on the data table by country and region, combining ODA and OOF (based on `Total official flows by country and region (ODA+OOF)` from the [OECD](https://stats.oecd.org/viewhtml.aspx?datasetcode=REF_TOTALOFFICIAL&lang=en))
- `Source/UNPK/PfP/data_mission.csv`: Peacekeeping mission data from the International Peace Institute's *Providing for Peacekeeping* database ([link](https://www.ipinst.org/providing-for-peacekeeping-database))
- `Source/UNPK/Kathman/mission-month_12-2019.xlsx`: Peacekeeping mission data from the UN Peacekeeping Personnel Data Project ([link](https://kathmanundata.weebly.com/mission-personnel-dataset.html))
- `Source/UCDP-PRIO/ucdp-brd-conf-181.csv`: UCDP Battle-Related Deaths Dataset ([link](https://ucdp.uu.se/downloads/index.html#battlerelated))
- `Source/EPR/data_20190124.csv`: Ethnic Power Relations Core dataset ([link](https://icr.ethz.ch/data/epr/core/))
- `Source/Foreign policy similarity/fpsim_us.csv`: Chance-Corrected Measures of Foreign Policy Similarity ([link](https://doi.org/10.7910/DVN/ALVXLM))
- `Source/UNGA voting/IdealpointestimatesAll_Mar2021.csv`: UNGA Votes and Ideal Points ([link](https://github.com/evoeten/United-Nations-General-Assembly-Votes-and-Ideal-Points))
- `Source/Lujala - Resources/Lujala Spoils of Nature data ONSET.dta`: Natural Resources, from Lujala's 2010 JPR article ([link](https://www.prio.org/journals/jpr/replicationdata))
- `Source/Krause/Copy of PAM_ID%20V.1.5%20Updated%2029JULY2015-3.csv`: Women's Participation in Peace Agreements ([link](https://janakrause.org/publications-3/))

# Analysis 

Next, the script `2_analyze_implementation.R` performs the following tasks:

- load the data for analysis
- conducting the analyses in the article and supporting information (`KQJT_SI.pdf`)

This script creates the following tables and figures:

- Figure 1
- Table 1
- Table 2
- All tables and figures in the supporting information

All tables and figures produced by these scripts are written to a folder named "Output", which is in the replication package but empty until the script is run. 

# Software version information

All analyses using R were executed on 4.2.0 (2022-04-22) on macOS Monterey 12.4; a list of packages and versions used is at the end of this file. 

```
R version 4.2.0 (2022-04-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] panelAR_0.1     ggridges_0.5.3  estimatr_0.30.6 texreg_1.38.6   lme4_1.1-29    
 [6] Matrix_1.4-1    bit64_4.0.5     bit_4.0.4       forcats_0.5.1   stringr_1.4.0  
[11] dplyr_1.0.9     purrr_0.3.4     readr_2.1.2     tidyr_1.2.0     tibble_3.1.7   
[16] ggplot2_3.3.6   tidyverse_1.3.1

loaded via a namespace (and not attached):
 [1] nlme_3.1-157      fs_1.5.2          usethis_2.1.5     lubridate_1.8.0  
 [5] devtools_2.4.3    httr_1.4.3        rprojroot_2.0.3   tools_4.2.0      
 [9] backports_1.4.1   utf8_1.2.2        R6_2.5.1          DBI_1.1.2        
[13] colorspace_2.0-3  withr_2.5.0       tidyselect_1.1.2  prettyunits_1.1.1
[17] processx_3.6.1    curl_4.3.2        compiler_4.2.0    cli_3.3.0        
[21] rvest_1.0.2       xml2_1.3.3        desc_1.4.1        labeling_0.4.2   
[25] scales_1.2.0      callr_3.7.0       digest_0.6.29     minqa_1.2.4      
[29] foreign_0.8-82    rmarkdown_2.14    rio_0.5.29        pkgconfig_2.0.3  
[33] htmltools_0.5.2   sessioninfo_1.2.2 dbplyr_2.1.1      fastmap_1.1.0    
[37] rlang_1.0.2       readxl_1.4.0      rstudioapi_0.13   farver_2.1.0     
[41] generics_0.1.2    jsonlite_1.8.0    car_3.1-0         zip_2.2.0        
[45] magrittr_2.0.3    Formula_1.2-4     Rcpp_1.0.8.3      munsell_0.5.0    
[49] fansi_1.0.3       abind_1.4-5       lifecycle_1.0.1   stringi_1.7.6    
[53] yaml_2.3.5        carData_3.0-5     MASS_7.3-56       brio_1.1.3       
[57] plyr_1.8.7        pkgbuild_1.3.1    grid_4.2.0        crayon_1.5.1     
[61] lattice_0.20-45   splines_4.2.0     haven_2.5.0       stargazer_5.2.3  
[65] hms_1.1.1         knitr_1.39        ps_1.7.0          pillar_1.7.0     
[69] boot_1.3-28       pkgload_1.2.4     reprex_2.0.1      glue_1.6.2       
[73] evaluate_0.15     data.table_1.14.2 remotes_2.4.2     modelr_0.1.8     
[77] nloptr_2.0.3      vctrs_0.4.1       tzdb_0.3.0        testthat_3.1.4   
[81] cellranger_1.1.0  gtable_0.3.0      assertthat_0.2.1  cachem_1.0.6     
[85] xfun_0.31         openxlsx_4.2.5    broom_0.8.0       countrycode_1.4.0
[89] memoise_2.0.1     ellipsis_0.3.2   
```
